#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>

int main()
{
	int n,m;
	int sum = 0;
	int arr[100] = { 0 };
	scanf("%d", &n);
	for (int i = 0; i < n; i++)
	{
		scanf("%d", &m);
		arr[i] = m;
	}
	for (int i = 0; i < n; i++)
	{
		for (int j = i + 1; j < n; j++)
		{
			sum += arr[i] * arr[j];
		}
	}
	printf("%d", sum);
	return 0;
}